<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>富文本编辑器</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.8/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <blockquote class="layui-elem-quote">
            富文本编辑器使用开源项目：ckeditor<br>
            具体使用请参考下方官网，以下仅做示例<br>
            <a href="https://ckeditor.com/docs/ckeditor4/latest/guide/dev_framed.html" target="_blank" class="layui-btn layui-btn-danger">ckeditor</a>
        </blockquote>
        <div class="layui-col-md">
            <textarea id="ckeditor" name="content" style="visibility: hidden;" class="layui-textarea">ckeditor</textarea>
        </div>
    </div>
</div>

<script src="../..//lib/ckeditor/ckeditor.js"></script>
<script>
    var ckeditor = CKEDITOR.replace('ckeditor', {
        language: 'zh-cn',
        filebrowserUploadUrl: '/company/Upload/ckeditor',
        removePlugins: 'flash,iframe,language,scayt'
    });
    ckeditor.on('change', function () {
        document.getElementById('ckeditor').innerHTML = ckeditor.getData();
    });
    // (function () {
    //     var ckeditor = CKEDITOR.replace('ckeditor', {
    //         language: 'zh-cn',
    //         filebrowserUploadUrl: '文件上传地址',
    //         removePlugins: 'flash,iframe'
    //     });
    //     ckeditor.on('change', function (ev) {
    //         document.getElementById('ckeditor').innerHTML = ckeditor.getData();
    //     });
    // })();
</script>
<pre class="layui-code">


         (function () {
        var ckeditor = CKEDITOR.replace('ckeditor', {
            language: 'zh-cn',
            filebrowserUploadUrl: '文件上传地址',
            removePlugins:'flash,iframe'
        });
        ckeditor.on('change', function (ev) {
            document.getElementById('ckeditor').innerHTML = ckeditor.getData();
        });
    })();
    // 后端成功
    {
    "uploaded": 1,
    "fileName": "foo.jpg",
    "url": "/files/foo.jpg"
    }
    // 后端失败
    {
    "uploaded": 0,
    "error": {
        "message": "The file is too big."
        }
    }

        </pre>


</body>
</html>